from django.urls import path
from django.urls import re_path

from apps.users import views

urlpatterns = [
    # 判断用户名是否重复注册
    re_path(r"^usernames/(?P<username>[A-Za-z0-9_-]{5,20})/count/$", views.UsernameCount.as_view()),
    # 判断手机号是否重复注册接口
    re_path(r"^mobiles/(?P<mobile>1[3-9]\d{9})/count/$", views.MobileCountView.as_view()),
    # 用户注册
    re_path(r"^register/$", views.RegisterView.as_view()),
    # 图片验证码
    path("image_codes/<uuid:uuid>/", views.PictureView.as_view()),
    # 短信验证码
    re_path(r"^sms_codes/(?P<mobile>1[3-9]\d{9})/$", views.SMSCodeView.as_view()),
    # 用户登陆视图
    re_path(r"^login/$", views.LoginView.as_view()),
    # 退出登陆
    re_path(r"logout/$", views.LoginOutView.as_view()),
    # 用户中心页面展示
    re_path(r"^info/$", views.UserCenterDataView.as_view()),
    # 修改用户的密码
    re_path(r'^password/$', views.ChangePasswordView.as_view()),
    # 用户浏览历史记录
    re_path(r'^browse_histories/$', views.UserBrowseHistory.as_view()),
]